#ifndef QREMOTE_ITEM_H
#define QREMOTE_ITEM_H

#include <QObject>
#include <QVariant>

#include "QRemoteObject2.h"
#include "QRemoteFunction.h"
#include "QRemoteObjectAdvance_global.h"

/*
*QRemoteItem是专门为远程对象优化的类，虽然任何类都可以成为远程对象，但如果直接继承该类则可事半功倍
*/

class QREMOTEOBJECTADVANCE_EXPORT QRemoteItem:public QObject,public QRemoteFunction
{
    Q_OBJECT
    Q_CLASS_NAME(QRemoteItem)

    Q_PROPERTY(QRemoteItem* parent READ parent WRITE setParent NOTIFY parentChanged)
public:
    QRemoteItem(QRemoteItem* parent = NULL);
    ~QRemoteItem();

    void setParent(QRemoteItem* item);
    QRemoteItem* parent();

signals:
    void parentChanged(QRemoteItem* item);
    void occupied();//该对象被占领了
    void released();//该对象被释放了
};

#endif
